<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" isELIgnored="false" %>
<%@taglib prefix="security" uri="http://www.springframework.org/security/tags" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<!DOCTYPE html>
<html>

<head>
    <!-- 页面meta -->
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">

    <title>乐学优课OA系统</title>
    <%--<meta name="description" content="AdminLTE2定制版">
    <meta name="keywords" content="AdminLTE2定制版">--%>

    <meta content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no" name="viewport">

    <link rel="stylesheet" href="${pageContext.request.contextPath}/plugins/bootstrap/css/bootstrap.min.css">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/plugins/font-awesome/css/font-awesome.min.css">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/plugins/ionicons/css/ionicons.min.css">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/plugins/iCheck/square/blue.css">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/plugins/morris/morris.css">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/plugins/jvectormap/jquery-jvectormap-1.2.2.css">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/plugins/datepicker/datepicker3.css">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/plugins/daterangepicker/daterangepicker.css">
    <link rel="stylesheet"
          href="${pageContext.request.contextPath}/plugins/bootstrap-wysihtml5/bootstrap3-wysihtml5.min.css">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/plugins/datatables/dataTables.bootstrap.css">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/plugins/treeTable/jquery.treetable.css">
    <link rel="stylesheet"
          href="${pageContext.request.contextPath}/plugins/treeTable/jquery.treetable.theme.default.css">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/plugins/select2/select2.css">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/plugins/colorpicker/bootstrap-colorpicker.min.css">
    <link rel="stylesheet"
          href="${pageContext.request.contextPath}/plugins/bootstrap-markdown/css/bootstrap-markdown.min.css">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/plugins/adminLTE/css/AdminLTE.css">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/plugins/adminLTE/css/skins/_all-skins.min.css">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/css/style.css">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/plugins/ionslider/ion.rangeSlider.css">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/plugins/ionslider/ion.rangeSlider.skinNice.css">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/plugins/bootstrap-slider/slider.css">
    <link rel="stylesheet"
          href="${pageContext.request.contextPath}/plugins/bootstrap-datetimepicker/bootstrap-datetimepicker.css">

    <style>
        .pull-right {
            padding-top: 20px;
        }

        a {
            margin-left: 10px;
        }

        .table_wrap {
            width: 100%;
            overflow: auto;
        }

        table {
            table-layout: fixed;
            width: 100%;
            border-collapse: separate;
            border-spacing: 0;
            border: 1px solid #DDDDDD;
        }

        td, th {
            width: 100px;
            height: 30px;
            text-align: center;
            box-sizing: border-box;
            border-right: 1px solid #DDDDDD;
            border-bottom: 1px solid #DDDDDD;
            /*单元格 超出长度 显示...*/
            overflow: hidden;
            white-space: nowrap;
            text-overflow: ellipsis;
        }

        /* 表头固定 */
        thead tr th {
            position: sticky;
            top: 0;
            background: #F4F4F5;
            height: 30px;
        }

        /* 首列固定/最后一列固定*/
        th:first-child,
        td:first-child {
            position: sticky;
            left: 0;
            background: #F4F4F5;
            text-align: center;
            right: 0px;
            border-left: 1px solid #DDDDDD;
            width: 60px;
        }

        th:last-child,
        td:last-child {
            position: sticky;
            left: 0;
            background: #F4F4F5;
            text-align: center;
            right: 0px;
            border-left: 1px solid #DDDDDD;
            width: 225px;
        }

        /* 表头首列和最后一列强制最顶层 */
        th:last-child,
        th:first-child {
            z-index: 3;
            /*左上角单元格z-index，切记要设置，不然表格纵向横向滚动时会被该单元格右方或者下方的单元格遮挡*/
            background: #F4F4F5;
        }

    </style>
</head>

<body class="hold-transition skin-purple sidebar-mini">

<div class="wrapper">

    <!-- 页面头部 -->
    <jsp:include page="header.jsp"></jsp:include>
    <!-- 页面头部 /-->
    <!-- 导航侧栏 -->
    <jsp:include page="aside.jsp"></jsp:include>

    <!-- 导航侧栏 /-->

    <!-- 内容区域 -->
    <div class="content-wrapper">

        <!-- 内容头部 -->
        <section class="content-header">
            <h1>
                学生信息
                <small>基本信息</small>
            </h1>
            <ol class="breadcrumb">
                <li><a href="${pageContext.request.contextPath}/index.jsp"><i class="fa fa-dashboard"></i> 首页</a></li>
                <li><a
                        href="${pageContext.request.contextPath}/classes/findByUser">班级管理</a></li>
                <li class="active">基本信息</li>
            </ol>
        </section>
        <!-- 内容头部 /-->

        <!-- 正文区域 -->
        <section class="content">
            <!-- .box-body -->
            <%--<div class="box-header with-border">
                <h3 class="box-title">列表</h3>
            </div>--%>

            <div class="box-body">
                <!-- 数据表格 -->
                <div class="table-box">
                    <!--工具栏-->
                    <div class="pull-left">
                        <div class="form-group form-inline">
                            <div class="btn-group">
                                <button type="button" class="btn btn-default" title="添加"
                                        onclick='location.href="${pageContext.request.contextPath}/common/addSkip?cid=${cid}"'>
                                    <i class="fa fa-file-o"></i> 添加
                                </button>
                                <button type="button" class="btn btn-default" title="刷新"
                                        onclick="window.location.reload();">
                                    <i class="fa fa-refresh"></i> 刷新
                                </button>
                            </div>
                        </div>
                    </div>

                    <div class="pull-right">
                        <form class="form-inline" action="${pageContext.request.contextPath}/common/condition"
                              method="post">
                            <security:csrfInput/>
                            <input type="hidden" name="cid" value="${cid}">
                            <div class="form-group">
                                <label for="name">姓名</label>
                                <input type="text" name="name" value="${name}" placeholder="请输入学生姓名"
                                       class="form-control"
                                       id="name">
                            </div>
                            <div class="form-group">
                                <label for="enrollTime">报名时间</label>
                                <input type="date" name="enrollTime" value="${enrollTime}" placeholder="请输入学生报名时间"
                                       class="form-control"
                                       id="enrollTime">
                            </div>

                            <div class="form-group">
                                <label for="consultTeacher">咨询老师</label>
                                <input type="text" name="consultTeacher" value="${consultTeacher}"
                                       placeholder="请输入学生咨询老师" class="form-control"
                                       id="consultTeacher">
                            </div>
                            <button type="submit" class="btn btn-default">查询</button>
                        </form>
                    </div>

                    <!--工具栏/-->

                    <%--横向滚动条--%>
                    <div class="table_wrap">
                        <!--数据列表-->
                        <table id="dataList"
                               class="table table-bordered table-striped table-hover dataTable">
                            <thead>
                            <tr>
                                <th>姓名</th>
                                <th>年龄</th>
                                <th>性别</th>
                                <th>学历</th>
                                <th>专业</th>
                                <th>职业状态</th>
                                <th>学习目标</th>
                                <th>所在班级</th>
                                <th>班级进度</th>
                                <th>学习状态</th>
                                <th>报名时间</th>
                                <th>咨询老师</th>
                                <th>操作</th>
                            </tr>
                            </thead>

                            <tbody>
                            <c:forEach items="${pageInfo.list}" var="student">
                                <input type="hidden" name="id" value="${student.id}">
                                <input type="hidden" name="cid" value="${student.cid}">
                                <tr>
                                    <td>${student.name}</td>
                                    <td>${student.age}</td>
                                    <td>
                                        <c:choose>
                                            <c:when test="${student.gender==0}">女</c:when>
                                            <c:when test="${student.gender==1}">男</c:when>
                                        </c:choose>
                                    </td>
                                    <td>
                                        <c:choose>
                                            <c:when test="${student.education==0}">
                                                高中及以下
                                            </c:when>
                                            <c:when test="${student.education==1}">
                                                大专
                                            </c:when>
                                            <c:when test="${student.education==2}">
                                                普通本科
                                            </c:when>
                                            <c:when test="${student.education==3}">
                                                重点本科
                                            </c:when>
                                            <c:when test="${student.education==4}">
                                                研究生
                                            </c:when>
                                            <c:when test="${student.education==5}">
                                                博士
                                            </c:when>
                                        </c:choose>
                                    </td>
                                    <td>${student.major}</td>
                                    <td>
                                        <c:choose>
                                            <c:when test="${student.jobState==0}">
                                                在职
                                            </c:when>
                                            <c:when test="${student.jobState==1}">
                                                待业
                                            </c:when>
                                            <c:when test="${student.jobState==2}">
                                                在读
                                            </c:when>
                                            <c:when test="${student.jobState==3}">
                                                临近毕业
                                            </c:when>
                                        </c:choose>
                                    </td>
                                    <td>
                                        <c:choose>
                                            <c:when test="${student.objective==0}">
                                                全职就业
                                            </c:when>
                                            <c:when test="${student.objective==1}">
                                                兴趣爱好
                                            </c:when>
                                            <c:when test="${student.objective==0}">
                                                兼职副业
                                            </c:when>
                                        </c:choose>
                                    </td>
                                    <td>${student.className}</td>
                                    <td>${student.speed}</td>
                                    <td>
                                        <c:choose>
                                            <c:when test="${student.status==0}">
                                                在读
                                            </c:when>
                                            <c:when test="${student.status==1}">
                                                落课
                                            </c:when>
                                            <c:when test="${student.status==2}">
                                                未跟课
                                            </c:when>
                                            <c:when test="${student.status==3}">
                                                休学
                                            </c:when>
                                            <c:when test="${student.status==4}">
                                                退学
                                            </c:when>
                                            <c:when test="${student.status==5}">
                                                救救孩子吧
                                            </c:when>
                                        </c:choose>
                                    </td>
                                    <td>
                                        <fmt:formatDate pattern="yyyy-MM-dd"
                                                        value='${student.enrollTime}'></fmt:formatDate>
                                    </td>
                                    <td>${student.consultTeacher}</td>
                                    <td class="text-left">
                                        <a href="${pageContext.request.contextPath}/common/findById?id=${student.id}"
                                           class="btn bg-olive btn-xs">编辑</a>
                                        <a href="${pageContext.request.contextPath}/common/findDetailById?id=${student.id}"
                                           class="btn bg-olive btn-xs">详情</a>
                                        <a href="${pageContext.request.contextPath}/transfer/transferApply?id=${student.id}"
                                           class="btn bg-olive btn-xs">转班</a>
                                        <a href="${pageContext.request.contextPath}/quit/findById?id=${student.id}"
                                           class="btn bg-olive btn-xs">休学</a>
                                        <a href="${pageContext.request.contextPath}/refund/findById?id=${student.id}"
                                           class="btn bg-olive btn-xs">退费</a>
                                    </td>
                                </tr>
                            </c:forEach>
                            </tbody>
                        </table>
                    </div>
                </div>
            </div>
            <fmt:formatDate pattern="yyyy-MM-dd" value='${enrollTime}' var="date"></fmt:formatDate>
            <%--分页--%>
            <div class="box-footer">
                <div class="pull-right">
                    <div class="form-group form-inline">
                        总共<span style="color: red">${pageInfo.pages}</span>页，共<span
                            style="color: red">${pageInfo.total}</span> 条数据
                        每页
                        <select class="form-control" id="sel">
                            <option <c:if test="${pageInfo.pageSize==10}">selected </c:if>>10</option>
                            <option <c:if test="${pageInfo.pageSize==15}">selected </c:if>>15</option>
                            <option <c:if test="${pageInfo.pageSize==20}">selected </c:if>>20</option>
                            <option <c:if test="${pageInfo.pageSize==50}">selected </c:if>>50</option>
                        </select> 条
                    </div>
                </div>

                <div class="box-tools pull-left">
                    <ul class="pagination">
                        <c:if test="${pageInfo.pageNum==1}">
                            <li class="disabled">
                                <span>
                                    首页
                                </span>
                            </li>
                            <li class="disabled">
                                <span>
                                    上一页
                                </span>
                            </li>
                        </c:if>
                        <c:if test="${pageInfo.pageNum>1}">
                            <li>
                                <a href="${pageContext.request.contextPath}/common/condition?cid=${cid}&name=${name}&enrollTime=${enrollTime}&consultTeacher=${consultTeacher}&pageNum=1&pageSize=${pageInfo.pageSize}"
                                   aria-label="Previous">首页</a>
                            </li>
                            <li>
                                <a href="${pageContext.request.contextPath}/common/condition?cid=${cid}&name=${name}&enrollTime=${enrollTime}&consultTeacher=${consultTeacher}&pageNum=${pageInfo.pageNum - 1}&pageSize=${pageInfo.pageSize}">上一页</a>
                            </li>
                        </c:if>

                        <c:forEach begin="1" end="${pageInfo.pages}" var="i">

                            <c:if test="${pageInfo.pageNum == i}">
                                <li class="active"><a
                                        href="${pageContext.request.contextPath}/common/condition?cid=${cid}&name=${name}&enrollTime=${enrollTime}&consultTeacher=${consultTeacher}&pageNum=${i}&pageSize=${pageInfo.pageSize}">${i}</a>
                                </li>
                            </c:if>

                            <c:if test="${pageInfo.pageNum != i}">
                                <li>
                                    <a href="${pageContext.request.contextPath}/common/condition?cid=${cid}&name=${name}&enrollTime=${enrollTime}&consultTeacher=${consultTeacher}&pageNum=${i}&pageSize=${pageInfo.pageSize}">${i}</a>
                                </li>
                            </c:if>

                        </c:forEach>

                        <c:if test="${pageInfo.pageNum == pageInfo.pages}">
                            <li class="disabled">
                              <span>
                                  下一页
                              </span>
                            </li>
                            <li class="disabled">
                              <span>
                                  尾页
                              </span>
                            </li>
                        </c:if>

                        <c:if test="${pageInfo.pageNum < pageInfo.pages}">
                            <li>
                                <a href="${pageContext.request.contextPath}/common/condition?cid=${cid}&name=${name}&enrollTime=${enrollTime}&consultTeacher=${consultTeacher}&pageNum=${pageInfo.pageNum + 1}&pageSize=${pageInfo.pageSize}">下一页</a>
                            </li>
                            <li>
                                <a href="${pageContext.request.contextPath}/common/condition?cid=${cid}&name=${name}&enrollTime=${enrollTime}&consultTeacher=${consultTeacher}&pageNum=${pageInfo.pages}&pageSize=${pageInfo.pageSize}"
                                   aria-label="Next">尾页</a>
                            </li>
                        </c:if>
                    </ul>
                </div>
            </div>
    </div>
    </section>
</div>

</div>


<script src="../plugins/jQuery/jquery-2.2.3.min.js"></script>
<script src="../plugins/jQueryUI/jquery-ui.min.js"></script>
<script>
    $.widget.bridge('uibutton', $.ui.button);
</script>
<script src="../plugins/bootstrap/js/bootstrap.min.js"></script>
<script src="../plugins/raphael/raphael-min.js"></script>
<script src="../plugins/morris/morris.min.js"></script>
<script src="../plugins/sparkline/jquery.sparkline.min.js"></script>
<script src="../plugins/jvectormap/jquery-jvectormap-1.2.2.min.js"></script>
<script src="../plugins/jvectormap/jquery-jvectormap-world-mill-en.js"></script>
<script src="../plugins/knob/jquery.knob.js"></script>
<script src="../plugins/daterangepicker/moment.min.js"></script>
<script src="../plugins/daterangepicker/daterangepicker.js"></script>
<script src="../plugins/daterangepicker/daterangepicker.zh-CN.js"></script>
<script src="../plugins/datepicker/bootstrap-datepicker.js"></script>
<script src="../plugins/datepicker/locales/bootstrap-datepicker.zh-CN.js"></script>
<script src="../plugins/bootstrap-wysihtml5/bootstrap3-wysihtml5.all.min.js"></script>
<script src="../plugins/slimScroll/jquery.slimscroll.min.js"></script>
<script src="../plugins/fastclick/fastclick.js"></script>
<script src="../plugins/iCheck/icheck.min.js"></script>
<script src="../plugins/adminLTE/js/app.min.js"></script>
<script src="../plugins/treeTable/jquery.treetable.js"></script>
<script src="../plugins/select2/select2.full.min.js"></script>
<script src="../plugins/colorpicker/bootstrap-colorpicker.min.js"></script>
<script src="../plugins/bootstrap-wysihtml5/bootstrap-wysihtml5.zh-CN.js"></script>
<script src="../plugins/bootstrap-markdown/js/bootstrap-markdown.js"></script>
<script src="../plugins/bootstrap-markdown/locale/bootstrap-markdown.zh.js"></script>
<script src="../plugins/bootstrap-markdown/js/markdown.js"></script>
<script src="../plugins/bootstrap-markdown/js/to-markdown.js"></script>
<script src="../plugins/ckeditor/ckeditor.js"></script>
<script src="../plugins/input-mask/jquery.inputmask.js"></script>
<script src="../plugins/input-mask/jquery.inputmask.date.extensions.js"></script>
<script src="../plugins/input-mask/jquery.inputmask.extensions.js"></script>
<script src="../plugins/datatables/jquery.dataTables.min.js"></script>
<script src="../plugins/datatables/dataTables.bootstrap.min.js"></script>
<script src="../plugins/chartjs/Chart.min.js"></script>
<script src="../plugins/flot/jquery.flot.min.js"></script>
<script src="../plugins/flot/jquery.flot.resize.min.js"></script>
<script src="../plugins/flot/jquery.flot.pie.min.js"></script>
<script src="../plugins/flot/jquery.flot.categories.min.js"></script>
<script src="../plugins/ionslider/ion.rangeSlider.min.js"></script>
<script src="../plugins/bootstrap-slider/bootstrap-slider.js"></script>
<script src="../plugins/bootstrap-datetimepicker/bootstrap-datetimepicker.js"></script>
<script src="../plugins/bootstrap-datetimepicker/locales/bootstrap-datetimepicker.zh-CN.js"></script>
<script>
    $(document).ready(function () {
        // 选择框
        $(".select2").select2();

        // WYSIHTML5编辑器
        $(".textarea").wysihtml5({
            locale: 'zh-CN'
        });
    });

    // 设置激活菜单
    function setSidebarActive(tagUri) {
        var liObj = $("#" + tagUri);
        if (liObj.length > 0) {
            liObj.parent().parent().addClass("active");
            liObj.addClass("active");
        }
    }

    //删除确认
    function deleteById(id) {
        var bool = confirm("确认删除?");
        if (bool) {
            location.href = "${pageContext.request.contextPath}/job/remove?id=" + id;
        }
    }

    $("#btn").click(function () {
        location.href = "${pageContext.request.contextPath}/common/condition"
    })

    window.onload = function () {
        var msg = "${msg}";
        if (msg != null && msg.length > 0) {
            alert(msg);
            ${sessionScope.remove("msg")}
        }
    }

    $(document).ready(function () {
        // 激活导航位置
        setSidebarActive("travellog-manage");

        // 列表按钮
        $("#dataList td input[type='checkbox']").iCheck({
            checkboxClass: 'icheckbox_square-blue',
            increaseArea: '20%'
        });

        // 全选操作
        $("#selall").click(function () {
            var clicks = $(this).is(':checked');
            if (!clicks) {
                $("#dataList td input[type='checkbox']").iCheck("uncheck");
            } else {
                $("#dataList td input[type='checkbox']").iCheck("check");
            }
            $(this).data("clicks", !clicks);
        });

        // sel 分页大小选择事件
        $("#sel").on('change', function () {
            var pageSize = this.value;
            window.location.replace("${pageContext.request.contextPath}/common/condition?cid=${cid}&name=${name}&enrollTime=${enrollTime}&consultTeacher=${consultTeacher}&pageNum=${pageInfo.pageNum}&pageSize=" + pageSize)
        })


    });
</script>
</body>

</html>